import os

# Django settings for Skran project.

#######################################################################################################################
# Configurations that can be changed
#
# Below here configurations that can be changed in development machines and for replace that use local_settings.py
#######################################################################################################################
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'skran',                      # Or path to database file if using sqlite3.
        'USER': 'root',                      # Not used with sqlite3.
        'PASSWORD': 'root',                  # Not used with sqlite3.
        'HOST': 'localhost',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '3306',                      # Set to empty string for default. Not used with sqlite3.
    }
}

SITE_ID = 1

DEBUG = True
TEMPLATE_DEBUG = DEBUG

# Try import local_settings configurations. All configurations wrote there will override above configurations 
try:
    from local_settings import *
except ImportError, exp:
    pass

#######################################################################################################################
# Configurations that can not be changed
#
# Configurations that will be used in production and will not override with local_settings.py
#######################################################################################################################

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
PROJECT_ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
MEDIA_ROOT = os.path.join(PROJECT_ROOT_PATH, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/admin/media/'

# Make this unique, and don't share it with anybody.
SECRET_KEY = 'sstq@ve62-@psspt#=@!7e6(g$p9*m04$spck3+@j)orcn9=n='

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    #'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'skran.urls'

PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])
TEMPLATE_DIRS = ( os.path.join(PROJECT_PATH, "templates"),)

INSTALLED_APPS = (
                  
    #Social oauth - django-social-auth
    'social_auth',              
                  
    #Django
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    
    #Tags - django-tagging
    'tagging',
    
    #skran
    'skran',
    'skran.public',
    'skran.projects',
    'skran.sprint',
    'skran.sprint.planning1',
    'skran.sprint.planning2',
    
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    'django.contrib.admindocs',
)

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.twitter.TwitterBackend',
    'social_auth.backends.facebook.FacebookBackend',
    'social_auth.backends.google.GoogleOAuthBackend',
    'social_auth.backends.google.GoogleOAuth2Backend',
    'social_auth.backends.google.GoogleBackend',
    #'social_auth.backends.yahoo.YahooBackend',
    #'social_auth.backends.browserid.BrowserIDBackend',
    #'social_auth.backends.contrib.linkedin.LinkedinBackend',
    #'social_auth.backends.contrib.livejournal.LiveJournalBackend',
    #'social_auth.backends.contrib.orkut.OrkutBackend',
    #'social_auth.backends.contrib.foursquare.FoursquareBackend',
    #'social_auth.backends.contrib.github.GithubBackend',
    #'social_auth.backends.contrib.dropbox.DropboxBackend',
    #'social_auth.backends.contrib.flickr.FlickrBackend',
    #'social_auth.backends.contrib.instagram.InstagramBackend',
    #'social_auth.backends.contrib.vkontakte.VkontakteBackend',
    #'social_auth.backends.contrib.skyrock.SkyrockBackend',
    #'social_auth.backends.contrib.yahoo.YahooOAuthBackend',
    #'social_auth.backends.OpenIDBackend',
    #'social_auth.backends.contrib.bitbucket.BitbucketBackend',
    #'social_auth.backends.contrib.live.LiveBackend',
    'django.contrib.auth.backends.ModelBackend',
)

#######################################################################################################################
# OAuth keys
#######################################################################################################################
TWITTER_CONSUMER_KEY         = 'hKgQaNm1mykwPEHTqQmvQ'
TWITTER_CONSUMER_SECRET      = 'zCLXxI91CCqsDs48ZrFWDcILrkkT5h2vdCgw3RZss'
FACEBOOK_APP_ID              = ''
FACEBOOK_API_SECRET          = ''
#LINKEDIN_CONSUMER_KEY        = ''
#LINKEDIN_CONSUMER_SECRET     = ''
#ORKUT_CONSUMER_KEY           = ''
#ORKUT_CONSUMER_SECRET        = ''
GOOGLE_CONSUMER_KEY          = ''
GOOGLE_CONSUMER_SECRET       = ''
GOOGLE_OAUTH2_CLIENT_ID      = '39579576059.apps.googleusercontent.com'
GOOGLE_OAUTH2_CLIENT_SECRET  = 'rFoOo5v79JI5FbK0tqr8rlhw'
#FOURSQUARE_CONSUMER_KEY      = ''
#FOURSQUARE_CONSUMER_SECRET   = ''
#GITHUB_APP_ID                = ''
#GITHUB_API_SECRET            = ''
#DROPBOX_APP_ID               = ''
#DROPBOX_API_SECRET           = ''
#FLICKR_APP_ID                = ''
#FLICKR_API_SECRET            = ''
#INSTAGRAM_CLIENT_ID          = ''
#INSTAGRAM_CLIENT_SECRET      = ''
#VK_APP_ID                    = ''
#VK_API_SECRET                = ''
#BITBUCKET_CONSUMER_KEY       = ''
#BITBUCKET_CONSUMER_SECRET    = ''
#LIVE_CLIENT_ID               = ''
#LIVE_CLIENT_SECRET           = ''
#SKYROCK_CONSUMER_KEY         = ''
#SKYROCK_CONSUMER_SECRET      = ''
YAHOO_CONSUMER_KEY           = ''
YAHOO_CONSUMER_SECRET        = ''

LOGIN_URL          = '/'
LOGIN_REDIRECT_URL = '/projects/'
LOGIN_ERROR_URL    = '/'

SOCIAL_AUTH_COMPLETE_URL_NAME  = 'socialauth_complete'
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'

#######################################################################################################################
# skran attributes
#######################################################################################################################
PROJECT_NAME="sKran"
